package api.flashlight;

import android.content.Context;

import java.lang.ref.SoftReference;

/**
 * Created by cyly on 16/5/18.
 */
public abstract class BeautyApi_toolbox {
    public abstract void init(Context ct);

    public abstract void showActivity(Context ct);

    public static String clazz = "api.flashlight.BeautyCenter_flashlight";

    private static SoftReference<BeautyApi_toolbox> sf;

    public synchronized static BeautyApi_toolbox getInstance() {
        if (sf == null || sf.get() == null) {
            Object o = null;
            try {
                o = Class.forName(clazz).newInstance();
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            } catch (InstantiationException e) {
                e.printStackTrace();
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            } catch (IllegalArgumentException e) {
                e.printStackTrace();
            }
            if (o != null) {
                sf = new SoftReference<BeautyApi_toolbox>((BeautyApi_toolbox)o);
                return (BeautyApi_toolbox)o;
            }
        }
        return sf == null ? null : sf.get();
    }

}
